/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 05 - 13
 * Time: 20:52
 */
public class Practice {
        public static int countSegments(String s) {
            int count = 0;
            for(int i = 0; i < s.length(); i++) {
                if((i == 0 || s.charAt(i - 1) == ' ') && s.charAt(i) != ' ') {
                    count++;
                }
            }
            return count;
        }

    public static void main1(String[] args) {
        System.out.println(countSegments(",,,, hello"));
    }
    public static void main(String[] args) {
        System.out.println(Solution.toLowerCase("AbcDE"));
    }
}
class Solution {
    public static String toLowerCase(String s) {
        return s.toLowerCase();
    }
}
